<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel workin\modules\increment\models\IdcardCheckSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Idcard Checks');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="idcard-check-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php Pjax::begin(); ?>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?php // echo Html::a(Yii::t('app', 'Create Idcard Check'), ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            'id',
            [
                'class' => \kartik\grid\ExpandRowColumn::className(),
                'width' => '50px',
                'value' => function ($model, $key, $index, $column) {
                    if ($model->result_detail){
                        return \kartik\grid\GridView::ROW_COLLAPSED;
                    }else{
                        return "没有回调";
                    }
                },
                'detail' => function ($model, $key, $index, $column) {
                    return Yii::$app->controller->renderPartial('idcard-check0-result.php', ['model'=>$model, 'id'=>$key]);
                },
                'headerOptions' => ['class' => 'kartik-sheet-style'],
                'expandOneOnly' => true,
//                'pageSummary'=>'总计',//可以是字符串，当为true时，自动合计
            ],
            'grant_key',
//            'api_key',
            'business_code',
            'name',
            'id_card',
            'order_report_id',
            'search_index',
//            'result_detail:ntext',
//            'result_photo_base64:ntext',
            'result_result',
            'result_report_id',
//            'result_auth_status',
            'result_service_fee',
            'result_is_real',
            'result_exp_status',
            'result_busi_code',
            'result_busi_msg',
            'result_extend_data:ntext',

//            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
    <?php Pjax::end(); ?>
</div>
